class TradeController {

    def searchAjax = {
        def trades = Trade.findAllByTradeNameIlike("%${params.query}%")
        //Create XML response
        render(contentType: "text/xml") {
            results() {
                trades.each { Trade trade -> result(){
                    name(trade.tradeName) //Optional id which will be available in onItemSelect id(person.id)
                 }
                }
            }
        }
    }
}
